/**
 * Created by jihb on 4/13/16.
 */
Ext.define('JYnovel.view.system.IndexView',{
    extend:'Ext.container.Viewport',
    alias:'widget.IndexView',
    layout:'border',
    initComponent:function () {
        var me = this;
        Ext.applyIf(me,{
            items:[{
                xtype:'IndexTopPanel',
                region:'north',
                height:40,
            },{
                xtype:'IndexLeftPanel',
                region:'west',
                split: true,
                collapsed: false,
                collapsible:true,
                width:200
            },{
                xtype:'IndexContentTabPanel',
                region:'center'
            }]
        });
        me.callParent(arguments);
    }
});
/**
 * 头部
 */
Ext.define('JYnovel.view.system.IndexTopPanel',{
    extend:'Ext.panel.Panel',
    alias:'widget.IndexTopPanel',
    title:'',
    ui: 'index-top',
    initComponent:function () {
        var me = this;
        Ext.applyIf(me,{
            tools:[{
                xtype:'label',
                name:'welcomeLabel',
                style: {
                    color:'#fff',
                    font:'14px'
                }
            },{
                xtype:'button',
                margin:5,
                text:'修改密码',
                icon:ctx+'/images/icon/key.png',
                name:'changePwdBtn',
                tooltip:'修改密码'
            },{
                xtype:'button',
                margin:5,
                text:'退出',
                icon:ctx+'/images/icon/door_out.png',
                name:'loginOutBtn',
                tooltip:'注销'
            }]
        });
        me.callParent(arguments);
    }
});
/**
 * 左侧菜单
 */
Ext.define('JYnovel.view.system.IndexLeftPanel',{
    extend:'Ext.panel.Panel',
    alias:'widget.IndexLeftPanel',
    title:'功能模块',
    layout:'accordion',
    minWidth:150,
    border:false,
    bodyPadding:0,
    defaults: {
        bodyStyle: 'padding:0px'
    },
    layout: {
        type: 'accordion',
        animate: true,
        hideCollapseTool: true,
        padding:0
    },
    initComponent:function () {
        var me = this;
        Ext.applyIf(me,{
            loader: {
                url: getUrl()+'/menu/list',
                autoLoad: false,
                renderer:'data'
            }
        });
        me.callParent(arguments);
    }
});


/**
 * 左侧菜单树
 */
Ext.define('JYnovel.view.system.IndexMenuTree',{
    extend:'Ext.tree.Panel',
    alias:'widget.IndexMenuTree',
    border:false,
    // store: 'system.MenuTreeStore',
    rootVisible: false,
    autoScroll:true,
    emptyText:'无数据',
    collapsed: false,
    collapsible:true,
    minHeight:100,
    displayField:'name',
    defaults: {
        bodyStyle: 'padding:0px'
    },
    initComponent:function () {
        var me = this;
        Ext.applyIf(me,{

        });
        me.callParent(arguments);
    }
});

/**
 * 中间内容视图
 */
Ext.define('JYnovel.view.system.IndexContentTabPanel',{
    extend:'Ext.tab.Panel',
    alias:'widget.IndexContentTabPanel',
    border:false,
    layout:'fit',
    initComponent:function () {
        var me = this;
        Ext.applyIf(me,{

        });
        me.callParent(arguments);
    }
});

Ext.define('JYnovel.view.system.IndexContentPanel',{
    extend:'Ext.panel.Panel',
    alias:'widget.IndexContentPanel',
    layout:'fit',
    border:false,
    closable:true,
    initComponent:function () {
        var me = this;
        Ext.applyIf(me,{

        });
        me.callParent(arguments);
    }
});

/**
 * 中间内容
 */
Ext.define('JYnovel.view.system.IndexContentHtmlPanel',{
    extend:'Ext.panel.Panel',
    alias:'widget.IndexContentHtmlPanel',
    border:false,
    layout:'fit',
    closable:true,
    initComponent:function () {
        var me = this;
        var loader = ExtCreateLoader({
            autoLoad:false,
            target:this,
            loadMask:true
        },function (data) {
            
        },false);
        Ext.applyIf(me,{
            loader:loader
        });
        me.callParent(arguments);
    }
});



